/**
 * Created by Administrator on 2017/5/9.
 */
$(function () {
    /**
     * @decription:登录方法
     * @author：xiaoxiaoxia
     */
    $("#login").click(function () {
        var params = "loginName=" + $("#loginName").val()
            + "&pwd=" + $("#pwd").val();
        $.ajax({
            url: "rest/web/login",
            type: "POST"
            ,
            dataType: "json",
            data: params,
            success: function (data) {
                var types = data.success;
                if (!types) {
                    alert(data.msg);
                }
                else {
                    sessionStorage.setItem("roleType", data.data.roleType);
                    if(data.data.roleType=="3"){//判断用户角色是否为访客用户，是情况跳转到报表统计，其他角色跳转到实时监控页面
                        window.location.href = "rest/web/flowDailyReport/toRealTime";
                    }else{
                        window.location.href = "rest/web/index/toIndexList";
                    }
                }
            }
        });
    });
});
